<?php
namespace App\Services\User;


use App\Services\ProjectValidate;

class ValidateAuth extends ProjectValidate
{

    /**
     * 自定义子类初始化
     * @param array $initData
     * @return mixed
     */
    public function initValidate($initData = [])
    {
        // TODO: Implement initValidate() method.
    }

//['name', 'app_name', 'server', 'module', 'controller', 'action', 'other_check', 'merge_auth']
    /**
     * @var array 验证规则集合
     */
    public $rules = [
        'page'      => 'int|min:1',
        'list_rows' => 'int|min:1',
        'id'        => 'int|min:1',
      //  'name' => 'between:2,20',
      //  'app_name' => 'max:128',
       // 'server' => 'between:2,32',
       // 'module' => 'between:2,32',
       // 'controller' => 'between:2,32',
       // 'action' => 'between:2,32',
       // 'other_check' => 'max:512',
       // 'merge_auth' => 'between:3,128',
        'role_id' => 'integer|min:0',
        'auth_ids' => ['regex' => '^(\d)+(,\d+)*'],
        'auth_id' => 'integer|min:0',
        'ids' => ['regex' => '^(\d)+(,\d+)*'],
        'roles' => 'min:2'
    ];

    /**
     * @var array 当前验证错误信息
     */
    public $messages = [
    ];

    /**
     * @var array 上面规则中定义的 key 的名字
     */
    public $attributes = [
    ];
}
